


var starNub = '';
var star = function(id){
    var stars = document.getElementById(id);
    var starsLi = stars.getElementsByTagName('li');
    for(var i = 0;i < starsLi.length; i++){
        starsLi[i].index = i;
        starsLi[i].onclick = function(){
            starNub = this.index + 1 + '星'
            console.log(starNub)
            for(var j=0;j<starsLi.length;j++){
                starsLi[j].className= j <= this.index ? 'starColor':'';
            }
        }
    }
}